<link rel="stylesheet" href="../core/resource/weui/weui.css?v=12">
<style>
</style>
<div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">房产信息设置</div>
		<div class="fui-header-right"></div>
</div>


<div class="weui_cells weui_cells_form">
<div class="weui_cell_hd"><label class="weui_label">房产名称</label></div>			 
			 <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;房产名称</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.title" placeholder="请输入房产名称">
                </div>
            </div>
			
				<div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;房产首页图片（单图）</label></div>
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.info.logo">
						<img class="round" src="{{tomedia(pagedata.info.logo) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp">
						<input class="weui_uploader_input" ng-click="up_file(pagedata.info,'logo','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
					</a>
				</div>
				<div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;户型图片（单图）</label></div>
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.info.huxing">
						<img class="round" src="{{tomedia(pagedata.info.huxing) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp">
						<input class="weui_uploader_input" ng-click="up_file(pagedata.info,'huxing','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
					</a>
				</div>

				<div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;幻灯片（多图）</label></div>
				<div class="weui_cells weui_cells_form" >
									<div class="weui_cell">
										<div class="weui_cell_bd weui_cell_primary">
											<div class="weui_uploader">
												<div class="weui_uploader_bd">
													<ul class="weui_uploader_files">
														<li ng-repeat="p in pagedata.info.hdp track by $index" class="weui_uploader_file" style="background-image:url('{{tomedia(p)}}')">
															<div class="upbtn" >
																<a style="color:#f60" href="javascript:;" ng-click="pagedata.info.hdp.splice($index-1,0,p);pagedata.info.hdp.splice($index+1,1)">上移</a>
																<a style="color:#f60" href="javascript:;" ng-click="pagedata.info.hdp.splice($index,1)">删除</a>
															</div>
														</li>
													</ul>
													<div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(pagedata.info,'hdp')">
													</div>
												</div>
											</div>
										</div>
									</div>
							</div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;联系人</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.name" placeholder="请输入联系人">
                </div>
            </div> 
            <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;联系电话</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="pagedata.info.mobile" placeholder="请输入联系电话">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;楼层</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="pagedata.info.louceng" placeholder="请输入楼层">
                </div>
            </div> 
            <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;面积/㎡</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="pagedata.info.mianji" placeholder="请输入面积/㎡">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;均价 元/㎡</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="pagedata.info.junjia" placeholder="请输入均价">
                </div>
            </div> 
            <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;总价/万元</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" ng-model="pagedata.info.price" placeholder="请输入总价">
                </div>
            </div> 			
			<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;详细地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.info.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
			</div>
			<div class="weui_cell weui_cell_select weui_select_after">
                <div class="weui_cell_hd">
                    选择类型
                </div>
               <div class="weui_cell_bd weui_cell_primary">
                    <select class="weui_select" name="select"  ng-model="pagedata.info.type">
                        <option  value="1">新房</option>
						<option  value="2">二手房</option>
                    </select>
            </div>
        </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">&nbsp;&nbsp;&nbsp;&nbsp;详细</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.info.desc" placeholder="请输入详细信息">
                </div>
            </div>
		<div class="form-group" >	
	<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择坐标</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<div class="row row-fix">
			<div class="col-xs-4 col-sm-4">
			<input type="text" ng-model="pagedata.info.lat_lng.lng" placeholder="地理经度"  class="form-control" />
			</div>
			<div class="col-xs-4 col-sm-4">
				<input type="text" ng-model="pagedata.info.lat_lng.lat" placeholder="地理纬度"  class="form-control" />
			</div>
			<div class="col-xs-4 col-sm-4">
				<button onclick="showCoordinate(this);" class="btn btn-primary" type="button">选择坐标</button>
			</div>
		</div>
	</div>
		</div>


			
</div>
<div class="weui_btn_area">
		 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.info,'fabu')">提交</a>
</div>

</div>

				<script type="text/javascript">
					function showCoordinate(elm) {
						require(["util"], function(util){
							var val = {};
							if(window.scope.pagedata.info.lat_lng==undefined){
								window.scope.pagedata.info.lat_lng={};
							}
							val.lng = parseFloat(window.scope.pagedata.info.lat_lng.lng);
							val.lat = parseFloat(window.scope.pagedata.info.lat_lng.lat);
							util.map(val, function(r){
								window.scope.pagedata.info.lat_lng.lng=r.lng;
								window.scope.pagedata.info.lat_lng.lat=r.lat;
								window.scope.$apply();
							});

						});
					}
				</script>

<script type="text/javascript">
window.scope.location(function(res){
		
		scope.$apply(function(){
			scope.pagedata.info.address = res.address;
		});
});
scope.pagedata.upimage=function(){
	scope.up_file(pagedata.post,'image','image')
	scope.pagedata.post.type=1;
	scope.post_json('orderubmit',scope.pagedata.post);
}
</script>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>